#include "WeatherWindow.h";

WeatherWindow::WeatherWindow(SdkTrayManager *mTrayMgr)
{
	this->mTrayMgr = mTrayMgr;

	windowCaption = mTrayMgr->createLabel(OgreBites::TL_LEFT, "TWeatherWindowCaption", "Set weather:", 350);
	
	menuItemsDayTime.push_back("Dawn");
	menuItemsDayTime.push_back("Noon");
	menuItemsDayTime.push_back("Afternoon");
	menuItemsDayTime.push_back("Sunset");
	menuItemsDayTime.push_back("Night");

	mDayTimeMenu = mTrayMgr->createLongSelectMenu(OgreBites::TL_LEFT, "TDayTimeMenu", "Set day time:", 350, 200, 5, menuItemsDayTime);

	menuItemsWeatherFenomen.push_back("Clear");
	menuItemsWeatherFenomen.push_back("Rainy");
	menuItemsWeatherFenomen.push_back("Snowy");

	mWeatherFenomenMenu = mTrayMgr->createLongSelectMenu(OgreBites::TL_LEFT, "TWeatherFenomenMenu", "Set weather:", 350, 200, 3, menuItemsWeatherFenomen);
}

//------------------------------------------------------------------------------------------

WeatherWindow::~WeatherWindow(void)
{
}

//-------------------------------------------------------------------------------------------

void WeatherWindow::show(void)
{
	mTrayMgr->moveWidgetToTray(windowCaption,OgreBites::TL_LEFT);
	windowCaption->show();
	mTrayMgr->moveWidgetToTray(mDayTimeMenu,OgreBites::TL_LEFT);
	mDayTimeMenu->show();
	mTrayMgr->moveWidgetToTray(mWeatherFenomenMenu,OgreBites::TL_LEFT);
	mWeatherFenomenMenu->show();
}

//-------------------------------------------------------------------------------------------

void WeatherWindow::hide(void)
{
    mTrayMgr->removeWidgetFromTray(windowCaption);
	windowCaption->hide();
    mTrayMgr->removeWidgetFromTray(mDayTimeMenu);
	mDayTimeMenu->hide();
    mTrayMgr->removeWidgetFromTray(mWeatherFenomenMenu);
	mWeatherFenomenMenu->hide();
}

//-------------------------------------------------------------------------------------------

WeatherWindow::eDayTimeSelection WeatherWindow::getDayTimeSelection(void)
{
	return (eDayTimeSelection)mDayTimeMenu->getSelectionIndex();
}

//-------------------------------------------------------------------------------------------

WeatherWindow::eWeatherFenomenSelection WeatherWindow::getWeatherFenomenSelection(void)
{
	return (eWeatherFenomenSelection)mWeatherFenomenMenu->getSelectionIndex();
}

//-------------------------------------------------------------------------------------------